using System;
using System.Collections.Generic;
using System.Text;
using LibrErian.Common;
using LibrErian.Common.Constants;
using LibrErian.Model;
using Microsoft.Practices.CompositeUI.SmartParts;
using Microsoft.Practices.CompositeUI.WinForms;
using Microsoft.Practices.CompositeUI;

namespace LibrErian.Modules.BasicBook
{
    public class NewBookController : WorkItemController
    {
        public void Run()
        {
            WorkItem.State["Book"] = new Book();
            BookView bookView = WorkItem.SmartParts.AddNew<BookView>();

            WindowSmartPartInfo info = new WindowSmartPartInfo();
            info.Title = "New book";

            WorkItem.Workspaces[WorkspaceNames.WindowWorkspace].Show(bookView, info);
        }
    }
}
